package cn.itsource.hrm.exceptions;
/*
* 全区异常处理
*
* */

import cn.itsource.hrm.util.AjaxResult;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class GlobalExceptionHandler {

    @ExceptionHandler(GlobalException.class)
    public AjaxResult myGlobalException(GlobalException e){
        e.printStackTrace();
        return AjaxResult.me().setSuccess(false).setMessage("入驻失败，请检查数据！！！"+e.getMessage());


    }

    @ExceptionHandler(Exception.class)
   public AjaxResult exceptionHandler(Exception  e){
        e.printStackTrace();
        return AjaxResult.me().setSuccess(false).setMessage("网络异常，请稍候再试");
    }


}


